from django.db import models
from utils.models import BaseModel


# 省市区表
class Area(models.Model):
    name = models.CharField(max_length=20, verbose_name='名字')
    parent = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, blank=True, verbose_name='上级行政区域名字')

    class Meta:
        db_table = 'tb_areas'
        verbose_name = '省市县'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name



